
log using "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\OUTPUT\OUTPUT.Organizational Memory.MANUSCRIPT MODEL FIT STATISTICS.04-30-2025.smcl", replace

*******************************************************************************************************************************************************************************************************************************
use "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\DATA\Organizational Memory.STATISTICAL DATABASE.04-30-2025.dta", replace

* (QIC_null - QIC_fitted)/QIC_null, intercept only model (L_0)
* R2 by Cohen: This is the most analogous index to the squared multiple correlations in linear regression. It represents the proportional reduction in the deviance wherein the deviance is treated as a measure of variation analogous but not identical to the variance in linear regression analysis.

*******************
* SET PROGRAM
program drop _all
program calculate , rclass
    return scalar result = `0'
    display return(result)
end
*******************


* Generate Interaction Terms.
gen h2_intrct = turnover*itsepabove15_los15pct
gen h3_intrct = turnover*cio5
gen h4_intrct = turnover*activityno_permil_pct

* FIT STATISTICS: MODEL 1 - MODEL 4
eststo: xtgee delay_pct c.turnover itsepabove15_los15pct i.cio5 activityno_permil_pct cio_tenure lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnoverb itsepabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb  , fam(bin) link(probit) corr(uns) vce(robust)

qic delay_pct if e(sample), i(a_id) t(fy) fam(bin) link(probit) corr(uns)
global qic_null = r(qic)
di $qic_null

discard

eststo: qic delay_pct turnover itsepabove15_los15pct cio5 activityno_permil_pct cio_tenure lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnoverb itsepabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb  , i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*

eststo: qic delay_pct turnover h2_intrct itsepabove15_los15pct cio5 activityno_permil_pct cio_tenure lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnoverb itsepabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb  , i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*

eststo: qic delay_pct turnover h3_intrct itsepabove15_los15pct cio5 activityno_permil_pct cio_tenure lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnoverb itsepabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb  , i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*
eststo: qic delay_pct turnover h4_intrct itsepabove15_los15pct cio5 activityno_permil_pct cio_tenure lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnoverb itsepabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb  , i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*
******************************************************************************************************************************************************************************
* [MODEL 5 - 8] [FIGURES 3D-6D] MANAGERIAL TURNOVER MODELS
gen mg_h2_intrct = turnover_gs13*gs13above15_los15pct
gen mg_h3_intrct = turnover_gs13*cio5
gen mg_h4_intrct = turnover_gs13*activityno_permil_pct

* [MODEL 5, FIGURE 3D] BASELINE 
eststo: qic delay_pct turnover_gs13  gs13above15_los15pct cio5 activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnover_gs13b gs13above15_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb, i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*

* [MODEL 6, FIGURE 4D] H2 
eststo: qic delay_pct turnover_gs13 mg_h2_intrct gs13above15_los15pct cio5  activityno_permil_pct cio_tenure lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnover_gs13b gs13above15_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb  , i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*

* [MODEL 7, FIGURE 5D] H3
eststo: qic delay_pct turnover_gs13 mg_h3_intrct gs13above15_los15pct cio5  activityno_permil_pct cio_tenure lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnover_gs13b gs13above15_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb  , i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*

* [MODEL 8, FIGURE 6D] H4
eststo: qic delay_pct turnover_gs13 mg_h4_intrct gs13above15_los15pct cio5  activityno_permil_pct cio_tenure lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnover_gs13b gs13above15_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb  , i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*
**********************************************************************************************************************************************
cd "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\OUTPUT\TABLES"
esttab est2 est4 est6 est8 est10 est12 est14 est16 using MANUSCRIPT-QIC.04-30-2025.rtf, ///
cells(b(star fmt(%9.3f)) se(par)) starl( * 0.10 ** 0.05 *** 0.010) label ///
stats(year qic pseudor chi2 N, fmt(3) label("Year Fixed Effects" "QIC" "Pseudo R-Squared" "Wald" "N")) replace
**********************************************************************************************************************************************

* [MODEL 9 - 12] [FIGURES 3B-6B] AGGREGATE VOLUNTARY TURNOVER MODELS
gen volh2_intrct = voluntary*volabove15_los15pct
gen volh3_intrct = voluntary*cio5
gen volh4_intrct = voluntary*activityno_permil_pct

* [MODEL 9, FIGURE 3B] BASELINE
discard

eststo: qic delay_pct voluntary volabove15_los15pct cio5 activityno_permil_pct lnitemp lnprojsize projects_no accrate  newprojects_pct  cio_tenure y1-y7 voluntaryb volabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   , i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*

* [MODEL 10, FIGURE 4B] H2 SERVICE LENGTH HYPOTHESIS
eststo: qic delay_pct voluntary volh2_intrct volabove15_los15pct cio5 activityno_permil_pct lnitemp lnprojsize projects_no accrate  newprojects_pct  cio_tenure y1-y7 voluntaryb volabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   , i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*

* [MODEL 11, FIGURE 5B] H3 CENTRALIZATION HYPOTHESIS
eststo: qic delay_pct voluntary volh3_intrct volabove15_los15pct cio5 activityno_permil_pct lnitemp lnprojsize projects_no accrate  newprojects_pct  cio_tenure y1-y7 voluntaryb volabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   , i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*

* [MODEL 12, FIGURE 6B] H4 STANDARDIZATION HYPOTHESIS
eststo: qic delay_pct voluntary volh4_intrct volabove15_los15pct cio5 activityno_permil_pct lnitemp lnprojsize projects_no accrate  newprojects_pct  cio_tenure y1-y7 voluntaryb volabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   , i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*
******************************************************************************************************************************************************************************

* [MODELS 13 - 16, FIGURES 3C - 6C] AGGREGATE INVOLUNTARY TURNOVER MODELS 
*
gen involh2_intrct = involuntary*involabove15_los15pct
gen involh3_intrct = involuntary*cio5
gen involh4_intrct = involuntary*activityno_permil_pct
*
*
* [MODEL 13, FIGURE 3C] H1 BASELINE HYPOTHESIS
eststo: qic delay_pct involuntary involabove15_los15pct cio5 activityno_permil_pct lnitemp lnprojsize projects_no accrate  newprojects_pct  cio_tenure y1-y7 involuntaryb involabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb  , i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*

* [MODEL 14, FIGURE 4C] H2 
eststo: qic delay_pct involuntary involh2_intrct involabove15_los15pct cio5 activityno_permil_pct lnitemp lnprojsize projects_no accrate  newprojects_pct  cio_tenure y1-y7 involuntaryb involabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb  , i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*

* [MODEL 15, FIGURE 5C] H3 
eststo: qic delay_pct involuntary involh3_intrct involabove15_los15pct cio5 activityno_permil_pct lnitemp lnprojsize projects_no accrate  newprojects_pct  cio_tenure y1-y7 involuntaryb involabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb  , i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*

* [MODEL 16, FIGURE 6C] H4 
eststo: qic delay_pct involuntary involh4_intrct involabove15_los15pct cio5 activityno_permil_pct lnitemp lnprojsize projects_no accrate  newprojects_pct  cio_tenure y1-y7 involuntaryb involabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb  , i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*

**********************************************************************************************************************************************
esttab est2 est4 est6 est8 est10 est12 est14 est16 using MANUSCRIPT-QIC.04-30-2025.rtf, ///
cells(b(star fmt(%9.3f)) se(par)) starl( * 0.10 ** 0.05 *** 0.010) label ///
stats(year qic pseudor chi2 N, fmt(3) label("Year Fixed Effects" "QIC" "Pseudo R-Squared" "Wald" "N")) append
***************************************************************************************************************************************************************************************************************************************************************************************************************
* [MODEL 17 - 20] MANAGERIAL VOLUNTARY TURNOVER MODELS
gen mgvol_h2_intrct = voluntary_gs13*volgs13_los15pct
gen mgvol_h3_intrct = voluntary_gs13*cio5
gen mgvol_h4_intrct = voluntary_gs13*activityno_permil_pct

* [MODEL 17, FIGURE 3E] H1 BASELINE HYPOTHESIS
discard

quietly eststo: xtgee delay_pct c.turnover_gs13  gs13above15_los15pct cio5 activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnover_gs13b gs13above15_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb, fam(bin) link(probit) corr(uns) vce(robust)


eststo: qic delay_pct voluntary_gs13 volgs13_los15pct  cio5 activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 voluntary_gs13b volgs13_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   if e(sample), i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*

* [MODEL 18, FIGURE 4E] H2 
eststo: qic delay_pct voluntary_gs13 mgvol_h2_intrct volgs13_los15pct  cio5 activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 voluntary_gs13b volgs13_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   if e(sample), i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*

* [MODEL 19, FIGURE 5E] H3 
eststo: qic delay_pct voluntary_gs13 mgvol_h3_intrct volgs13_los15pct  cio5 activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 voluntary_gs13b volgs13_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb     if e(sample), i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*

* [MODEL 20, FIGURE 6E] H4 
eststo: qic delay_pct voluntary_gs13 mgvol_h4_intrct volgs13_los15pct  cio5 activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 voluntary_gs13b volgs13_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   if e(sample), i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*
****************************************************************************************************************************************************
* [MODELS 21 - 24, FIGURES 3F - 6F] MANAGERIAL INVOLUNTARY TURNOVER MODELS
gen mginvol_h2_intrct = involuntary_gs13*involgs13_los15pct
gen mginvol_h3_intrct = involuntary_gs13*cio5
gen mginvol_h4_intrct = involuntary_gs13*activityno_permil_pct

* [MODEL 21, FIGURE 3F] H1 BASELINE HYPOTHESIS
eststo: qic delay_pct involuntary_gs13  involgs13_los15pct cio5 activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 involuntary_gs13b  involgs13_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   if e(sample), i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*


* [MODEL 22, FIGURE 4F] H2 
eststo: qic delay_pct involuntary_gs13 mginvol_h2_intrct involgs13_los15pct cio5 activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 involuntary_gs13b  involgs13_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   if e(sample), i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*

* [MODEL 23, FIGURE 5F] H3 
eststo: qic delay_pct involuntary_gs13 mginvol_h3_intrct involgs13_los15pct cio5 activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 involuntary_gs13b  involgs13_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   if e(sample), i(a_id) t(fy) fam(bin) link(probit) corr(uns) 
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*

* [MODEL 24, FIGURE 6F] H4 
eststo: qic delay_pct involuntary_gs13 mginvol_h4_intrct involgs13_los15pct cio5 activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 involuntary_gs13b  involgs13_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   if e(sample), i(a_id) t(fy) fam(bin) link(probit) corr(uns)
*
estadd scalar qic = r(qic)

eststo: calculate 1-(r(p)-r(qic))/(1-$qic_null)
estadd scalar pseudor = r(result)
*
*
**********************************************************************************************************************************************
esttab est3 est5 est7 est9 est11 est13 est15 est17 using MANUSCRIPT-QIC.04-30-2025.rtf, ///
cells(b(star fmt(%9.3f)) se(par)) starl( * 0.10 ** 0.05 *** 0.010) label ///
stats(year qic pseudor chi2 N, fmt(3) label("Year Fixed Effects" "QIC" "Pseudo R-Squared" "Wald" "N")) append
**********************************************************************************************************************************************
log close